package com.br.util;

import java.io.InputStream;
import java.util.Properties;


public class StopProperties {
    
    private static Properties p;
    
    public static String getValue(String key){
	try{
	    if(p==null){
		
		String env = System.getProperty("es.env");
		if(env==null || "".equals(env)){
		    env = "D";
		}
		
        	InputStream file = StopProperties.class.getResourceAsStream("/config_"+env+".properties");
        	p = new Properties();
        	p.load(file);
        	file.close();
	    }
	    return p.getProperty(key);
	}catch (Exception e) {
	    e.printStackTrace();
	}
	return "";
    }
    
}
